package net.pulseproject.commons.gui;

import java.net.URL;

import javax.swing.ImageIcon;

public class IconsLoaderImpl implements IconsLoader {

	@Override public final ImageIcon load(final IconType type) {
		final URL iconUrl = IconsLoaderImpl.class.getResource(type.getPath());
		if(iconUrl == null) {
			throw new RuntimeException("Could not find resource [" + type + "]!");
		}
		return new ImageIcon(iconUrl);
	}

}
